<template>
  <div id="box">
    <van-nav-bar
      title="详情"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <Dongtai :dynamicRecord="this.$route.params.detail"></Dongtai>
    <van-cell title="确属违规" is-link @click="results(true)" />
    <van-cell title="证据不足" is-link @click="results(false)" />
  </div>
</template>

<script>
import Dongtai from "./dongtai";
export default {
  data() {
    return {};
  },
  components: {
    Dongtai,
  },
  methods: {
    onClickLeft() {
      this.$router.push("/jianguan");
    },
    results(res) {
      let detail = this.$route.params.detail;
      if (res) {
        this.$axios
          .get(
            `${this.$api}complaints/violations/${detail.useID}/${
              detail.dataTime
            }/${res}/${2011}`
          )
          .then((res) => {
            console.log(res);
            this.$toast.fail(res.data);
          });
        console.log(true);
      } else {
        this.$axios
          .get(
            `${this.$api}complaints/violations/${detail.useID}/${
              detail.dataTime
            }/${res}/${2011}`
          )
          .then((res) => {
            console.log(res);
            this.$toast.fail(res.data);
          });
      }
    },
  },
};
</script>

<style>
</style>